Stability performance of the coupled algorithms for viscoelastic ink jet simulations

ABSTRACT

A system and method for simulating the flow of a viscoelastic fluid through a channel. The simulation including a interface between a first fluid and a second fluid. The simulation including the formation of a droplet. The simulation includes solving equations governing the viscoelastic flow of the first fluid through the channel, including viscoelastic stress equations that include a normalized relaxation time greater than or equal to 5. The calculations simulate the flow of the first fluid through the channel. The simulation is stable over a period time in which a droplet is formed. The simulation including a level set function that describes the position of the interface between the first and second fluids, and the evolution of the level set function over time describes the shape and position of the interface.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority under 35 U.S.C. §120 as a continuation-in-part of U.S. application Ser. No. 11/205,441 filed on Aug. 17, 2005, which claims the benefit of U.S. Provisional Application No. 60/680,747 filed May 13, 2005 and U.S. Provisional Application No. 60/684,763 filed May 25, 2005 under 35 U.S.C. §119(e). The contents of all above-referenced applications are incorporated by reference herein in their entirety.

BACKGROUND

1. Field of the Invention

The present invention relates to finite difference algorithms and associated models for viscoelastic ink ejection simulation.

2. Description of the Related Art

Results of ink-jet simulations are useful in the design of piezoelectric ink-jet print heads. A practical ink-jet simulation may be carried out using an analytical tool such as an equivalent circuit that receives as an input the dynamic voltage to be applied to a piezoelectric actuator and simulates the ink behavior under the influence of the ink cartridge, supply channel, vibration plate, and actuator. That is, from the input voltage and an ink flow rate, the equivalent circuit calculates an inflow pressure that drives computational fluid dynamics (CFD) code. The CFD code then solves the governing partial differential equations, i.e., the incompressible Navier-Stokes equations for two-phase flows, for fluid velocity, pressure, and interface position, and feeds back the ink flow rate to the equivalent circuit. The sequence is repeated as long as needed.

The dynamics of fluid flow through the ink-jet nozzle, coupled to surface tension effects along the ink-air interface and boundary conditions along the wall, act to determine the shape of the interface as it moves. Designing the CFD code largely involves taking into account the dynamically changing ink-air interface, which can be quite challenging.

One method that has been used to model the ink-air interface is the volume of fluid method (VOF). The VOF method performs mass conservation fairly well but has problem accurately modeling surface tension aspects of fluid flow, especially when the ink droplet is very small, as in less than 5 picoliters. The ability to eject small ink droplets is essential for photo quality ink-jet printers. The VOF method has given way to improved modeling methods, which include level set methods that are better at accurately capturing the ink-air interface in CFD simulations than the VOF method. There is an explicit relationship between the level set, the interface curvature, and the surface tension. This relationship allows the level set method to excel whenever surface tension is important.

Level set methods may make use of the finite element method. One problem with using the finite element method when applied to the level set method is the inability of the finite element method to accurately and effectively conserve the mass of the fluid being simulated. Finite difference analysis is better at conserving the mass of the fluid being simulated.

The dynamics of fluid flow are further complicated when the fluid is viscoelastic in nature. A viscoelastic fluid may be characterized by several parameters including, density, viscosity, elastic modulus, and others. A variety of numerical models are used to describe viscoelastic fluids including the Maxwell model, the Kelvin-Voigt model, Generalized Maxwell Model, the Standard Linear Solid Model, and the Oldroyd-B model.

The viscosity and the elastic modulus may be combined to give a relaxation time. The relaxation time of a viscoelastic fluid characterizes the amount of time it takes the fluid to dissipate elastic energy stored in the fluid. The relaxation time is normalized relative to the time period of the observation of the numerical experiment. The normalized relaxation time is referred to as the Deborah number. Prior art methods that attempted simulate the jettability of a viscoelastic fluid would only work when the Deborah number was less than 3.

The present invention is directed towards a method of simulating a viscoelastic fluid when the Deborah number is greater than 3.

SUMMARY OF THE INVENTION

An embodiment of the present invention is a method using a central processing unit to simulate and analyze the flow of a viscoelastic fluid through a channel. In which the simulation includes an interface between a first fluid that flows through the channel and a second fluid. The simulation also includes the formation of a droplet.

The present invention includes calculations to solve equations governing the viscoelastic flow of the first fluid through the channel. The equations include viscoelastic stress equations and a normalized relaxation time greater than or equal to 5. The calculations to simulate the flow of the first fluid through the channel are stable over a period time in which a droplet is formed.

The present invention includes updating periodically during the simulation a level set function for the first and second fluids. The level set function describes the position of the interface between the first and second fluids. The evolution of the level set function over time describes the shape and position of the interface over time.

An embodiment of the present invention is a computer readable storage medium encoded with instructions for performing the simulation. An embodiment of the present invention is a system including a central processing unit and memory configured to perform the simulation. An embodiment of the present invention includes a visual display of the level set function.

An embodiment of the present invention includes designing an ink-jet print head using the results of the simulation of the viscoelastic fluid. An embodiment of the present invention is a method in which the normalized relaxation time is normalized relative to the width of an opening of the channel. An embodiment of the present invention is a method in which the normalized relaxation time is normalized relative to a velocity scale. An embodiment of the present invention is a method of claim 1, wherein the simulation is performed by an algorithm that is explicit on an advection term, semi-implicit on a viscosity term, and implicit on a relaxation term.

An embodiment of the present invention is a method in which the droplet is formed, does not pinch off, and the simulation is stable over a period of time that includes the formation of the droplet an extension of the droplet above an initial interface, and a retraction of the droplet towards the initial interface.

An embodiment of the present invention is a method in which the normalized relaxation time is the Weissenberg number of the fluid. An embodiment of the present invention is a method in which the normalized relaxation time is greater than or equal to 10. An embodiment of the present invention is a method in which the normalized relaxation time is the Deborah number of the fluid. An embodiment of the present invention is a method in which a finite difference method is used in to perform the simulation.

An embodiment of the present invention is a method that is considered to be stable when the time step is greater than the mesh size raised to the power of the order of the approximation.

An embodiment of the present invention is a method that is considered to be stable when the time step is greater than or equal to the product of a safety factor and a mesh size raised to the power of the order of the approximation. In an embodiment of the present invention the safety factor is selected from the group consisting of 5, 10 and 20.

Other objects and attainments together with a fuller understanding of the invention will become apparent and appreciated by referring to the following description and claims taken in conjunction with the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

In the drawings wherein like reference symbols refer to like parts.

FIG. 1 is an illustration of an ink-jet nozzle;

FIG. 2 is an illustration of a mechanical model analogous to a viscoelastic fluid;

FIG. 3 is an illustration of the dynamic input voltage;

FIG. 4 is an illustration of the dynamic input pressure;

FIGS. 5-8 are illustrations of the droplet shapes; and

FIG. 9 is an illustration of a system for performing the method.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

The present invention is a stable method of simulating the flow of a viscoelastic fluid when the relaxation time of the fluid is large. The present invention may be used to simulate the ejection of a fluid from an ink jet nozzle. Although the present invention is presented in the context of a simulation of an ink-jet nozzle an individual skilled in the art would appreciate that the present invention may be adapted to also simulate the flow of a viscoelastic fluid in the production and processing steps of various viscoelastic fluids like plastics, rubber, glass, biomaterials and other fluids that exhibit viscoelastic behavior.

FIG. 1 is an illustration of a radial slice of a typical ink-jet nozzle 106. The geometry of the nozzle 106 may be axisymmetric. FIG. 1 is an illustration of an ink jet nozzle's geometry and is not drawn to scale. Ink 102 is stored in a cartridge, and driven through the nozzle 106 in response to a dynamic pressure applied at the lower boundary, i.e., the nozzle inlet. An interface 104 exists between the ink 102 and air 100. The dynamics of incompressible viscoelastic fluid flow, coupled with surface tension effects along the ink-air interface 104 and boundary conditions along the wall, act to determine the shape of the interface 104 as it moves through the nozzle. A negative pressure at the lower boundary induces a backflow, which causes a bubble of ink 102 to pinch off and move through the domain.

The fluid of a dye-based ink used in an ink-jet printer may be treated as a Newtonian fluid. In a Newtonian fluid, there is a linear relationship between a fluid's stress tensor and a fluid's rate of deformation tensor and is not related to any other instant. A method for simulating a Newtonian fluid is described in U.S. patent application Ser. No. 10/390,239 filed on Mar. 14, 2003, which is hereby incorporated by reference in its entirety.

Some pigment-based inks have better color durability than dye-based inks. These pigment-based inks do not behave like a Newtonian fluid. Pigment-based inks, as well as inks used in industrial printing applications, are often best described as a viscoelastic fluid. In a viscoelastic fluid, the relationship between the stress tensor of the fluid and the rate of deformation tensor at any particular instant depends on the deformation history. Viscoelastic inks and Newtonian inks having the same dynamic viscosity may behave very differently in terms of jettability and other ink-jet performance characteristics.

The relaxation time of a viscoelastic fluid is a parameter that characterizes the amount of time that the viscoelastic fluid is dependent upon the deformation history. The greater the relaxation time the harder it is to simulate the flow of the viscoelastic fluid.

In 1867, James Clerk Maxwell introduced a mathematical model of a gas that was both viscous and elastic. Over time, the Maxwell model has been further described as a linear combination of a spring and dashpot whose stress strain relationship is similar to the stress strain relationship of a viscoelastic fluid, and is shown in FIG. 2. Equation (1) is a stress strain relationship for a simple Maxwell model of a viscoelastic fluid shown in FIG. 2, where τ is the stress, ε is the strain, μ is the dynamic viscosity, and G is the elastic constant. Equation (1), assumes that both the spring and the dashpot are linear.

$\begin{matrix} {{{\frac{1}{G}\frac{\mathbb{d}\tau}{\mathbb{d}t}} + {\frac{1}{\mu}\tau}} = \frac{\mathbb{d}ɛ}{\mathbb{d}t}} & (1) \end{matrix}$

In order to simplify, equation (1), the following variables are defined.

$\lambda = \frac{\mu}{G}$ $s = {G\frac{\mathbb{d}ɛ}{\mathbb{d}t}}$

The new variable s is representative of the rate of deformation of the fluid, scaled with respect to the elastic constant. The new variable λ is the relaxation time of the viscoelastic fluid. We can now form a simplified equation (2).

$\begin{matrix} {{\frac{\mathbb{d}\tau}{\mathbb{d}t} + {\frac{1}{\lambda}\tau}} = s} & (2) \end{matrix}$

Equation (2) describes a relationship between the stress τ at a given instant on both the rate of deformation s and the rate of change of the stress τ. If a viscoelastic fluid has a long relaxation time λ, the fluid behaves very differently from a Newtonian fluid. For a Newtonian fluid, the material model does not have the spring. The constitutive relation for a Newtonian fluid is simply:

$\begin{matrix} {\tau = {\mu\frac{\mathbb{d}ɛ}{\mathbb{d}t}}} & (3) \end{matrix}$

An embodiment of the present invention may be based on a continuum mechanics version of the Maxwell model such as the Oldroyd-B model. In an embodiment of the present invention, the dynamic viscosity and relaxation time are constant. The present invention is described in terms of a two-phase immiscible incompressible flow in the presence of surface tension and a density jump across an interface separating a viscoelastic fluid (ink) and a Newtonian fluid (air). An individual skilled in the art will appreciate that the present invention may be used to simulate other fluid systems and other simulation models. An embodiment of the present invention may include a macroscopic slipping contact line model that describes the dynamics of air-ink-wall boundary.

An embodiment of the present invention is a finite difference method for simulating the flow of a viscoelastic fluid that is first order accurate in time. An alternative embodiment of the present invention is second order accurate in time. Embodiments of the present invention are stable over a wide range of relaxation times.

An embodiment of the present invention may incorporate some or all of: a coupled level set projection method for an incompressible immiscible two-phase fluid flow; a high order Godunov type algorithm for convection terms in momentum equations and the level set convection equation; a central difference method for viscosity, surface tension, and upper-convected derivative terms; and an equivalent circuit for inflow pressure (or inflow rate). In an embodiment of the present invention that is first order accurate in time may include, a first order upwind algorithm designed for the convection term in the viscoelastic stress equations. An embodiment of the present invention that is second order accurate in time may include a second order Godunov upwind method for the convection term in the viscoelastic stress equations.

The present invention is directed towards the effect of large normalized relaxation times, λ>3. Under typical nozzle geometry and typical driving conditions, droplets of viscoelastic fluid do not pinch off if the normalized relaxation time is greater than 1, λ>1. The present application provides evidence that an embodiment of the present invention is capable of simulating fluid flow when the normalized relaxation time exceeds 3. A simulation code based on the present invention has been used to simulate the ejection of viscoelastic fluid under typical driving conditions and nozzle geometry. Prior art simulation codes have experienced stability problem when simulating highly viscoelastic fluid flows. Both of our algorithms are pretty stable. However, the stability performances of the first-order and second-order algorithms are different. We found the 2nd-order algorithm is much more stable than the first order one. The difference will be shown in terms of the range of relaxation time.

Stability Performance

The stability performance of the present invention may be checked by testing the stability of an embodiment of the present invention on a typical geometry such as that shown in FIG. 1. An embodiment of the present invention was tested on a simulated nozzle with a diameter of 25 microns at the opening and 49.5 microns at the nozzle inlet. The length of the nozzle opening section, where the diameter is 25 microns, is 26 microns. The length of the slanted section as shown in FIG. 1 is 55 microns and the length of the nozzle inlet section is 7.5 microns.

In the simulated nozzle, the inflow pressure may be given by an equivalent circuit that simulates the effect of: the ink cartridge; the supply channel; the vibration plate; the PZT actuator; the applied voltage; the ink in the channel; and the ink in the cartridge. FIG. 3 is an illustration of the dynamic input voltage with peak voltages at ±11.15 volts. The dynamic inflow pressure corresponding to the dynamic input voltage for a viscoelastic fluid is illustrated in FIG. 4 and is similar to that of a Newtonian fluid. The outflow pressure at the top of the solution domain is set to zero.

The solution domain for the simulated nozzle is {(r,z)|0≦r≦27.3 μm, 0≦z≦725 μm}. The height of the solution domain above the nozzle is greater than the height of comparable solution domain in which the fluid is Newtonian. An individual skilled in the art can appreciate that the solution domain for a viscoelastic fluid is selected to take into account the length of the droplet produced by viscoelastic ink. An individual skilled in the art would appreciate that the solution domain is adapted to take into account the properties of the fluid.

In the simulated nozzle, the advancing contact angle is 70 and the receding contact angle is 20. In the simulated nozzle, the initial meniscus is flat and is 3.5 microns lower than the nozzle opening. An individual skilled in the art would appreciate that other simulation parameters may be chosen without going beyond the spirit and scope of the present invention.

An individual skilled in the art will appreciate that the scaling of any simulation problem is important. If the scaling is incorrect, round off error accumulates making it impossible to obtain stable results. In an embodiment of the present invention, a length scale and a velocity scale are used to normalize the solution domain. An individual skilled in the art will appreciate that other scales may be used without going beyond the scope of the present invention.

In an embodiment of the present invention, the length scale is the diameter of the nozzle opening, which in the case of the simulated nozzle is 25 microns. In which case the normalized solution domain is {(r,z)|0≦r≦1.092, 0≦z≦29}. An individual skilled in the art will appreciate that the length scale, need not be exactly equal to the nozzle diameter but should be on the same order of magnitude. In the context of the present invention, the same order of magnitude is equal to 1/10 or 10 times the reference value. In an alternative embodiment of the present invention, the length scale is the same order of magnitude as the droplet ejected by the nozzle.

In an embodiment of the present invention, an additional length scale is used to normalize the simulation space. In an embodiment of the present invention the velocity scale is 6 meters/second. An individual skilled in the art will appreciate that the exact value of the velocity scale is not as important as the order of magnitude the velocity scale. In an embodiment of the present invention, the velocity scale is on the same order of magnitude as the maximum expected velocity of the fluid being simulated. In alternative embodiment of the present invention the velocity scale is on the order of magnitude of: an exit velocity of a droplet, a maximum velocity of a droplet, a mean velocity of a droplet, a mean velocity of a fluid.

The properties of the fluid used in the simulated nozzle used to showcase the stability of the present invention are: a density of ρ₁=1070 kg/m³; a solvent viscosity of μ₁=1.750×10⁻³ kg/m·sec³; a solute viscosity of μ_(p)=1.750×10⁻³ kg/m·sec³; and a surface tension of σ=0.032 kg/sec². The non-dimension parameters of the fluid are: a Reynolds number based on the solvent viscosity Re=91.71; a Weber number of the fluid is We=30.09; and a Reynolds number based on the solute viscosity Re_(p)=91.71. The density of the air is ρ₂=1.225 kg/m³ and the viscosity of the air is μ₂=1.77625×10⁻³ kg/m·sec³.

Several numerical experiments have been done using the simulated nozzle described above, in which the normalized relaxation time was varied. FIG. 5 is an illustration of the droplet shapes produced at various time using a second order scheme and a normalized relaxation time of 5. FIG. 6 is an illustration of the droplet shapes produced at various time using a second order scheme and a normalized relaxation time of 20. FIG. 7 is an illustration of the droplet shapes produced at various time using a second order scheme and a normalized relaxation time of 100. FIG. 8 is an illustration of the droplet shapes produced at various time using a second order scheme and a normalized relaxation time of 1000.

Comparing results in FIGS. 5 through 8, we see that, although the normalized relaxation time had little effect on the inflow pressure, it can dramatically influence the droplet speed and shape. Using a typical dynamic input voltage the ink droplet is not ejected when the normalized relaxation time is greater than 1, λ>1. In order to eject viscoelastic ink with a large normalized relaxation time, a new ejection method should be used which may include: applying a higher peak voltage; using different dynamic voltage patterns; and/or using a new nozzle geometry. An embodiment of the present invention is useful tool for exploring variations in the ejection method.

FIGS. 5 through 8 provide some information about the behavior of a viscoelastic fluid as the normalized relaxation time λ increase such as: the head of the droplet reaches farther from the nozzle; it takes longer for the head of the droplet to reach the farthest extent and to be pulled back towards the nozzle; and the shape of the droplet becomes more slender and longer before it is pulled back to the nozzle. As shown in FIG. 8, when the normalized relaxation time is 1000, λ=1000, we see that the head of the ink droplet reaches the farthest point at about 82.3 μs. However, when the normalized relaxation time is 5, λ=5, it is at its farthest point around 38.8 μs as shown in FIG. 5. Further analysis shows that when λ=1000 it takes 140 μs for the droplet to come back to the nozzle opening and it takes about 60 μs when λ=5. These results are consistent with the behavior of viscoelastic fluids. A longer relaxation time means more elastic energy is stored in the fluid, it takes more time to store the energy and it takes longer to release the energy. It is also noteworthy that the long and slender droplet in FIG. 8 does not pinch off. A Newtonian droplet as thin as the one shown in FIG. 8 would pinch off due to capillary instabilities.

Prior art methods have had trouble simulating the flow of a viscoelastic fluid with a long relaxation time. Embodiments of the present invention may take the form of a first order simulation process or a second-order simulation process while giving very similar results. The stability performance of the first-order simulation process and second-order simulation process are not similar.

In order for the stability performance of the various simulation processes to be compared, a metric must first be created which quantifies the stability of a simulation process. For cases in which a droplet pinches off, we consider the simulation process to be stable if the process can simulate the ejection of the entire droplet (including the major droplet and the satellites, if any) which then passes through the end of the solution domain. For cases in which the ink droplet does not pinch off, we deem the simulation process to be stable if the code can simulate the ejection and retraction process until the droplet is pulled back to the nozzle opening.

Table 1 shows the stability performance of the first-order and second-order simulation processes, and the maximum initial time step that may be used to effectively simulate the motion of the viscoelastic fluid. One can see that the second-order algorithm is much more stable than the first-order one. The first-order simulation process is stable when the normalized relaxation time is less than or equal to 300, λ≦300. The second-order simulation process is stable when the normalized relaxation time is less than or equal to 2000, λ≦2000, after which point a smaller initial time step is required. Embodiments of the present invention are capable of simulating viscoelastic fluids when the normalized relaxation time is greater than 2000, λ>2000. Inks used in industrial printing applications tend not to have normalized relaxation times greater than 2000.

Normalized Max. stable initial relaxation time 1st-order 2nd-order Δt(1st/2^(nd)) λ = 5 Stable Stable 0.002/0.002 λ = 10 Stable Stable 0.002/0.002 λ = 50 Stable Stable 0.002/0.002 λ = 100 Stable Stable 0.002/0.002 λ = 300 Stable Stable 0.002/0.002 λ = 500 Unstable Stable  NA/0.002 λ = 1000 Unstable Stable  NA/0.002 λ = 2000 Unstable Stable  NA/0.001

The present invention is a stable simulation process that is capable of simulating a viscoelastic fluid with a large normalized relaxation time. This simulation process may be used to develop a method of effectively ejecting such viscoelastic fluids.

Governing Equations

The following is an implementation of a simulation method including an embodiment of the present invention. A first fluid is a viscoelastic fluid, which may be a dye-based ink. The Oldroyd-b viscoelastic fluid model is used to present the algorithms. Equations (3) in the appendix (along with other numbered equations referenced in the following discussion) are representative of the behavior of the first fluid.

The equation including a time derivate of the stress in equation (4) is a tensor version of equation (2). The second fluid, which may be air and is governed by the incompressible Navier-Stokes equations (5).

In equations (4) and (5), the rate of deformation tensor and the fluid velocity are defined in (6).

The Lagrangian time derivative is D{right arrow over (u)}_(i)/Dt=[∂/∂t+({right arrow over (u)}_(i)·∇)]{right arrow over (u)}_(i), p_(i) is the pressure, τ₁ is the viscoelastic stress tensor of the first fluid, ρ_(i) is the density, μ_(i) is the dynamic viscosity, λ_(i) is the viscoelastic relaxation time, μ_(p1) is the solute dynamic viscosity of first fluid. The subscript i=1, 2 is used to denote the variable or constant in the viscoelastic first fluid (1) or the Newtonian second fluid (2).

In an embodiment of the present invention, the second fluid is assumed to be Newtonian and the viscoelastic stress tensor τ₂ of the second fluid vanishes. In an embodiment of the present invention, the dynamic viscosity μ₁ is the dynamic viscosity of the solvent used in the first fluid, which is often water. In addition, the first three terms together in the second equation in (4): Dτ₁/Dt−τ₁·(∇u₁)−(∇u₁)^(T)·τ₁ are collectively referred to as the upper-convected time derivative of the viscoelastic stress tensor. It is used in the Oldroyd-b model to guarantee the material frame indifference. If one replaces the upper-convected time derivative with the material time derivative, the second equation of (3) will look similar to (2) in format. Also, because the size of typical ink-jet print heads is small, the gravity term is not important and is therefore omitted. The inclusion of a gravity term does not change any part of the numerical schemes described in the next sections. Finally, the numerical schemes described herein work equally well for cases in which both fluids are viscoelastic.

The boundary conditions at the interface of the two phases are the continuity of the velocity and the jump condition set forth in equation (7), where {circumflex over (n)} is the unit normal to the interface between the first fluid and the second fluid, κ is the curvature of the interface, and σ is the surface tension coefficient of the interface.

In an embodiment of the present invention, a level set method may be used to trace the interface between the first fluid and the second fluid. The interface is a zero level Γ of a level set function φ as defined in equation (8).

The level set function φ is defined as the signed distance to the interface Γ. The unit normal {circumflex over (n)} on the interface Γ and the interface curvature κ can be expressed in terms of level set function φ as shown in equations (9).

In order to simplify the presentation of the simulation method, the governing equations for the first fluid and the second fluid are merged, the merged velocity field, viscoelastic stress tensor, pressure field, and rate of deformation tensor is defined as set forth in (10).

The governing equations for the two-phase flow and the boundary condition at the interface can be re-written as (11), (12), and (13), where δ is the Dirac delta function and the density, dynamic viscosity, relaxation time, and solute viscosity are defined in (14). The fact that the surface tension can be written as a body force concentrated at the interface greatly reduces the difficulty solving two-phase fluid flows.

To make the governing equations dimensionless, the definitions in (14) are used, where the primed quantities are dimensionless and L, U, ρ₁, μ₁ are respectively the characteristic length, characteristic velocity, density of the first fluid, and solvent dynamic viscosity of the first fluid.

Substituting the definitions in (15) into equations (11), (12), and (13), and dropping the primes, yields the dimensionless governing equations set forth in (16), (17), and (18), in which the density ratio, viscosity ratio, normalized relaxation time, The Reynolds number of the solvent Re, the Weber number We, and the Reynolds number of the solute Re_(p) are defined by (19).

Since the interface moves with the fluid, the evolution of the level set is governed by the level set convection equation (20). This form is chosen because the interface moves advectively.

Since equations (9), (16), (17), (18), and (20) are expressed in terms of the vector notation, they assume the same form in Cartesian coordinates and axisymmetric coordinates.

First-Order Numerical Algorithm on Rectangular Grids

In this section, the first algorithm, which is first-order accurate in time and second-order accurate in space, is explained. In the following, the superscript n (or n+1) denotes the time step, as illustrated in equation (25). Given quantities {right arrow over (u)}^(n), p^(n), φ^(n), τ^(n), the purpose is to obtain {right arrow over (u)}^(n+1), p^(n+1), φ^(n+1), τ^(n+1), τ^(n+1) which satisfy the condition of incompressibility (16).

Temporal Discretization

The boundary condition on the nozzle wall stems from the above-mentioned contact model. The inflow pressure at t^(n+1) is given by the equivalent circuit.

Level Set Update

The level set is updated by following (24). The time-centered advection term [({right arrow over (u)}·∇)φ]^(n+1/2) is evaluated using an explicit predictor-corrector scheme that requires only the available data at t^(n). Once φ^(n+1) is obtained, φ^(n+1/2) is computed by using the update rule in (25).

Explicit Time Integration for Momentum Equations

The explicit temporal scheme set forth in (26) is used to discretize the momentum equations. An intermediate variable {right arrow over (u)}* is defined in (27), the time-discretized Navier-Stokes equation is written in terms of {right arrow over (u)}* in (28). A second-order explicit Godunov scheme for the advection term and the central difference for the viscosity term is applied in (27). The determination of {right arrow over (u)}* needs only values at time step t^(n).

Projection for {right arrow over (u)}^(n+1)

To satisfy the incompressibility condition for time step t^(n+1), the divergence operator is applied on both sides of (28). Since ∇·{right arrow over (u)}^(n+1)=0, the projection equation (29), which is elliptic, is obtained. It reduces to a Poisson equation if the density ratio ρ(φ^(n+1/2)) is a constant. After the pressure p^(n+1) is solved from equation (29), the velocity field {right arrow over (u)}^(n+1) can be obtained by (28).

To simplify the implementation for arbitrary geometries, a finite element projection of the form set forth in (30) is used, in which ψ is the finite element weighting function, Γ₁ denotes all the boundary conditions, and {right arrow over (u)}^(BC) is the given inflow or outflow velocity of the fluid. The divergence theorem may be used to show that the implied boundary condition at Γ₁ is equation (31).

The choice of the weighting function, as well as the approximation for the pressure and velocity, is flexible. In an embodiment of the present invention, the weighting function and the pressure may be located at grid points and may be piecewise bilinear, the velocity may be cell-centered and piecewise constant. The inflow velocity, if prescribed, may be located at the center of each boundary edge.

Semi-Implicit Algorithm for the Viscoelastic Stresses

In the projection step, both a new pressure and a new velocity are obtained. The time-centered velocity at cell centers can be calculated using equation (32). A semi-implicit algorithm may be used to integrate the viscoelastic stress equation in time. A time-discretized, viscoelastic stress equation is shown in equation (33), where {right arrow over (u)}^(n+1/2) is the time-centered velocity field at cell centers described in equation (32). Equation (34) is a rearrangement of equation (33).

Advection Terms in the Navier-Stokes and the Level Set Equations

In an embodiment of the present invention the velocity components of {right arrow over (u)}_(i,j) ^(n) and the level set function values φ_(i,j) ^(n) are located at cell centers, and the pressure values p_(i,j) ^(n) are located at grid points. The time-centered edge velocities and level set function values (also called predictors), such as

${\overset{->}{u}}_{{i + {1/2}},j}^{n + {1/2}},\phi_{{i + {1/2}},j}^{n + {1/2}},$ and so on, are located at the middle point of each edge of the grid. Equations (35) and (36) may be used to evaluate the advection terms. In these two equations, the edge velocities and edge level sets may be obtained by using a Taylor expansion in space and time. The time derivatives {right arrow over (u)}_(t) ^(n) and φ_(t) ^(n) are substituted by the Navier-Stokes equations and the level set convection equation. The procedure involves extrapolating from both sides of the edge and then applying the Godunov type upwinding to decide which extrapolation to use. The foregoing explains how to obtain

${\overset{->}{u}}_{{i + {1/2}},j}^{n + {1/2}};$ the other time-centered edge values may be derived in a similar manner.

At the middle point of a vertical edge, the time-centered edge velocity extrapolated from the left is given in (37), where F_(i,j) ^(n) is defined in (38). The edge velocity as extrapolated from the right is given in (39). Note that

${\overset{->}{u}}_{{i + {1/2}},j}^{{n + {1/2}},L}\mspace{14mu}{and}\mspace{14mu}{\overset{->}{u}}_{{i + {1/2}},j}^{{n + {1/2}},R}$ are used to denote these values.

The monotonicity-limited central difference is used for the evaluation of the normal slopes, which is {right arrow over (u)}_(r,i,j) ^(n) in this case. The limiting is done on each component of the velocity at t^(n) separately. The transverse derivative term is evaluated by first extrapolating {right arrow over (u)} to the transverse faces from the cell center, using normal derivatives only, and then applying the Godunov type upwinding.

The next step is the Godunov upwinding. The components of the velocity and the level set values are calculated based on

${\overset{->}{u}}_{{i + {1/2}},j}^{{n + {1/2}},L}\mspace{14mu}{and}\mspace{14mu}{\overset{->}{u}}_{{i + {1/2}},j}^{{n + {1/2}},R}$ are chosen according to equations (40) and (41).

These intermediate edge velocities are, in general, not divergence-free. An intermediate marker-and-cell (MAC) projection may be used to make all the normal edge velocities divergence free. An intermediate function q is a function, which is relatively smooth. The velocity {right arrow over (u)}^(e) is representative of the edge velocities as calculated in equations (40) and (41). In an embodiment of the present invention equation (42) is divergence free. Taking the divergence of equation (42) gives us equation (43). Discretizing and solving equation (43) it is possible to obtain q and make the intermediate edge velocities {right arrow over (u)}^(e) divergence free. The function q is used to make the intermediate edge velocity divergence free.

In an embodiment of the present invention q is cell centered. Multiplying equation (43) by r for axi-symmetric coordinates and omitting the superscript n for simplicity, yields equation (44). Hence, the discretized MAC projection equation in (45) is obtained.

The boundary condition for the intermediate function q should be compatible with the physical boundary conditions. On the solid walls, the no flow condition {right arrow over (u)}·{circumflex over (n)}=0 is consistent with the intermediate edge velocity {right arrow over (u)}^(e); which implies that there is a homogeneous Neumann boundary condition on q, namely ∂q/∂{circumflex over (n)}=0. At the inflow or outflow, if a velocity is prescribed, it is again a homogeneous Neumann boundary condition on q, since the given velocity at t^(n+1) has been included in obtaining {right arrow over (u)}^(e). If a pressure is given, the corresponding condition on q is as set forth in (46), where the factor 2 in the denominator appears because the edge velocity is time-centered.

Evaluation of the Normal Derivatives

In an embodiment of the present invention, the normal derivatives in equations (37) and (39) can be evaluated using a monotonicity limited central difference scheme. In an embodiment of the present invention a fourth order monotonicity limited central difference scheme may be used to calculate the normal derivatives. The following scheme may be used to calculate {right arrow over (u)}_(r,i,j) ^(n) on a uniform rectangular grid. The scheme may be written in terms of several difference operator definitions defined in (48). The difference operators are used to define a limiting slope in (49). The limiting slope is used to define a second order limited slope in (50). The second order limited slope is used to define a fourth order limited slope in (51). The fourth order monotonicity limited normal derivative is defined in (52).

Evaluation of the Tangential Derivatives

In an embodiment of the present invention the tangential derivative are computed using an upwind scheme, such as the one described in equation (53). In equation (53),

û_(i, j + 1/2)  and  v̂_(i, j + 1/2)^(adv) are calculated using a Taylor's extrapolation, from the top and bottom of the edge. Equation (54) is an example of how these derivatives may be calculated, neglecting the pressure, viscosity, and surface tension terms. The derivatives at the right hand side are again computed using the monotonicity-limited central difference scheme described above. As described in equations (55) and (56) an upwind evaluation may be used to obtain

û_(i, j + 1/2)  and  v̂_(i, j + 1/2)^(adv).

Spatial Discretization of the Viscoelastic Stress Equations

Time-discretized equation (34) needs to be discretized in space and time. The first term in the square bracket is a convection term. The simple first-order upwind algorithm set forth in equation (57) may be used to evaluate the term on uniform rectangular grids. The second and third terms in the square bracket of equation (34) and the viscosity term may be discretized using a central difference scheme.

Constraint on Time Step

Since the time integration scheme is 2nd-order explicit for the convection term and 1st-order explicit for viscosity, the constraint on time step Δt is determined by the CFL condition, surface tension, viscosity, and total acceleration, as in (61). The time step calculated in equation (61) is a good indicator of stability. If the time step becomes less than a stability threshold than the system is considered to be unstable. The stability threshold may be relative to the length of the simulation. The stability threshold may also be related to a multiple of the minimum accuracy of the number type used in the calculations. Alternatively, the stability may be calculated over a number of time steps in which a small time step is allowed over a short period of time relative to the whole simulation time.

In a simulation process using an adaptive time step method, the simulation process is identified as unstable when the time step approaches the accuracy of the simulation process. For example if the simulation process uses a second order approximation and the mesh size is Δx, than the simulation is considered to be stable as long as Δt>Δx^(n), wherein n is the order of the simulation. The simulation process is approaching instability as Δt approaches Δx². One practice for insuring stability is ensuring that Δt≦20Δx². For example if mesh size is 0.01 than the time step should never be less than 0.002. The safety factor of 20 may be used to ensure a safety margin in the simulation method. Although 20 is the safety factor used in this example other safety factors are used in practice such as 2, 5, and 10, or a safety factor between 2 and 50. The reasoning behind this is that the capacity of the simulation process is limited by the mesh size and the order of the approximations used by the simulation process, as your normalized step size approaches these limits errors start to accumulate at an unrecoverable pace. An individual skilled in the art will appreciate how to adapt this stability criterion to an adaptive mesh and or a fixed time step.

Second-Order Numerical Algorithm on Rectangular Grids

The discussion now turns to the second algorithm for two-phase viscoelastic fluid flows. The algorithm is semi-implicit in time and it is second-order accurate in both space and time. Given quantities {right arrow over (u)}^(n), p^(n−1/2), φ^(n), τ^(n) the purpose is to obtain {right arrow over (u)}^(n+1), p^(n+1/2), φ^(n+1), τ^(n+1) which satisfy the condition of incompressibility (16). In an embodiment of the present invention the pressure lags by one half time step, this helps to insure the scheme is second-order accurate in time.

Temporal Discretization

The boundary condition on the nozzle wall stems from the above-mentioned contact model. The inflow pressure at t^(n+1) is given by the equivalent circuit.

Level Set Update

In an embodiment of the present invention level set values may be updated using equation (24). The time-centered advection term is evaluated using an explicit predictor-corrector scheme that requires only the data available at t^(n). Once φ^(n+1) is obtained, φ^(n+1/2) may be computed by using equation (25). The level set update for this second-order accurate in time algorithm is the same as that of the first-order in time algorithm presented in the previous section.

Semi-Implicit Time Integration for Momentum Equations

In an embodiment of the present invention a semi-implicit temporal scheme may be used to satisfy the momentum equations and continuity equation in a manner set up in equations (62) and (63). The momentum equations may be integrated as follows. An intermediate velocity {right arrow over (u)}** is defined in an equation (64), then a viscosity term may be inverted to obtain a non-divergence-free velocity predictor {right arrow over (u)}* by solving equations (65) and (66). This step insures the viscosity term is semi-implicit and increases code stability. Before doing the projection, the pressure contribution is deducted from the velocity predictor, as set forth in equation (67). This step is to make sure that the whole velocity field is projected to obtain the whole pressure. Finally solve the projection equation (68) by enforcing the incompressibility condition at t^(n+1).

In equation (64), a second-order explicit Godunov method is applied for the advection term, and the central difference for the viscosity term and surface tension term. It is noted that the viscoelastic stress term is evaluated at t^(n+1/2). The time-centered cell edge viscoelastic stresses are first obtained by Taylor's expansion and Godunov upwinding. The central difference is then employed to evaluate the divergence.

Projection for {right arrow over (u)}^(n+1)

To satisfy the incompressibility condition for time step t^(n+1), the divergence operator is applied on both sides of equation (68). Since ∇·{right arrow over (u)}^(n+1)=0, equation (68) results. After the pressure p^(n+1/2) is solved from equation (69), the velocity field {right arrow over (u)}^(n+1) can be obtained by using equation (68).

To simplify the implementation for arbitrary geometries, the finite element projection in equation (30) is used. The projection step for the second-order algorithm is the same as that of the first-order algorithm, except that the second-order algorithm has p^(n+1/2) instead of p^(n+1).

Mixed Algorithm for the Viscoelastic Stresses

An algorithm, which is explicit on the advection term, semi-implicit on the viscosity term, and implicit on the relaxation term is used to integrate the viscoelastic stress over time. The viscoelastic stress equation is discretized as set forth in equation (70), where {right arrow over (u)}^(n+1/2) and τ^(n+1/2) are the time-centered cell edge velocity and viscoelastic stress tensor may be calculated using a Taylor's expansion and Godunov upwinding. After arrangement, equation (70) can be rewritten as equation (71).

Re-Initialization of the Level Set

To correctly capture the interface and accurately calculate the surface tension, the level set function should remain a signed distance function to the interface as the calculations unfold. However, if the level set is updated by (24), it will not remain as such. Instead, the simulation is periodically stopped and a new level set function φ recreated, which is the signed distance function, i.e. |∇|=1, without changing the zero level set of the original level set function. A re-initialization algorithm for performing re-initialization in the present invention can be found in related application Ser. No. 10/729,637, filed on Dec. 5, 2003, and entitled “Selectively Reduced Bi-cubic Interpolation for Ink-Jet Simulations on Quadrilateral Grids,” the content of which is incorporated by reference herein. Other known and suitable re-initialization techniques may also be used.

Advection Terms in Navier-Stokes and Level Set Equations

The handling of the advection terms in the Navier-Stokes equations and level set equation is exactly the same as the first algorithm

Spatial Discretization of Viscoelastic Stress Equations

In an embodiment of the present invention the viscoelastic stress tensor τ_(i,j) ^(n) is co-located with velocity at cell centers. The time-centered stress tensor (i.e., the stress predictor),

τ_(i + 1/2, j)^(n + 1/2), is located at the middle point of each cell edge. Equation (72) may be employed to evaluate the advection term in equation (71). The time-centered edge stress tensor may be obtained by doing a Taylor expansion of τ in both space and time. The time derivative τ_(t) ^(n) may be substituted with the viscoelastic stress equation. The procedure involves extrapolating from both sides of the edge and then applying the Godunov type upwinding to decide which extrapolation to use. The following explains in detail how to obtain

τ_(i + 1/2, j)^(n + 1/2); the other time-centered edge values may be obtained in a similar manner.

At the middle point of a vertical edge, the time-centered edge viscoelastic stress tensor extrapolated from the left is given by equation (73), where G_(i,j) ^(n) is defined in equation (74). The edge stress tensor extrapolated from the right is given by equation (75). Note that

τ_(i + 1/2, j)^(n + 1/2, L), and  τ_(i + 1/2, j)^(n + 1/2, R), are used to denote these two different values.

In an embodiment of the present invention, a monotonicity limited central difference scheme may be used for the evaluation of the normal slopes, which are

τ_(r, i, j)^(n)  and  τ_(r, i + 1, j)^(n) in this case. The limiting may be done on each component of the viscoelastic stress separately at each time t^(n). The transverse derivative term may be evaluated by first extrapolating τ to the transverse faces from the cell center, using normal derivatives only, and then applying Godunov type upwinding scheme to calculate the transverse derivative terms.

In the Godunov upwinding scheme one of

τ_(i + 1/2, j)^(n + 1/2, L), and  τ_(i + 1/2, j)^(n + 1/2, R) is chosen to be the time-centered edge value according to the rules described in (76). The time-centered edge stresses may than be used in equation (72) for the calculation of the convection term in equation (71).

Evaluation of the Upper Convected Derivative Term

The second and third terms of the upper-convected derivative may be evaluated using expansion of the time centered cell edge velocities and the viscoelastic stress tensor. Since these two terms are similar, the expansion is described for only one term here. An individual skilled in the art will appreciate how to expand the third term in the same manner as the second term. In axi-symmetric coordinate systems, the first term of the upper-convected derivative can be expanded and expressed in a dyadic form such as the one set forth in equation (77). The value of the upper-convected terms may be evaluated at cell centers by making use of central differences and time-centered cell edge stresses. Omitting the superscript n+½ for simplicity sakes gives us the discretized terms as set forth in (78).

The Divergence of Viscoelastic Stresses

The divergence of the viscoelastic stresses in equation (64) may be evaluated using the time-centered edge stresses. To illustrate this, the divergence is first expanded as in equation (79). The divergence may be evaluated at the cell centers by use of the time-centered cell edge values and a central difference scheme. The discretized terms of equation (79) are given in (80).

Interface Thickness and Time Step Constraint

Because of the numerical difficulty caused by the Dirac delta function and by the sharp change of ρ, ν, and λ across the free surface, the Heaviside and Dirac delta functions are replaced by smoothed functions as described by equations (58)-(60).

Since the time integration scheme is 2nd-order explicit in time, the constraint on time step Δt is determined by the CFL condition, surface tension, viscosity, and total acceleration, as in equation (61).

System

Having described the details of the invention, an exemplary system 1000, which may be used to implement one or more aspects of the present invention will now be described with reference to FIG. 9. As illustrated in FIG. 9, the system includes a central processing unit (CPU) 1001 that provides computing resources and controls the computer. The CPU 1001 may be implemented with a microprocessor or the like, and may also include a graphics processor and/or a floating point coprocessor for mathematical computations. The system 1000 may also include system memory 1002, which may be in the form of random-access memory (RAM) and read-only memory (ROM).

A number of controllers and peripheral devices may also be provided, as shown in FIG. 9. An input controller 1003 represents an interface to various input device(s) 1004, such as a keyboard, mouse, or stylus. There may also be a scanner controller 1005, which communicates with a scanner 1006. The system 1000 may also include a storage controller 1007 for interfacing with one or more storage devices 1008 each of which includes a storage medium such as magnetic tape or disk, or an optical medium that might be used to record programs of instructions for operating systems, utilities and applications which may include embodiments of programs that implement various aspects of the present invention. Storage device(s) 1008 may also be used to store processed data or data to be processed in accordance with the invention. The system 1000 may also include a display controller 1009 for providing an interface to a display device 1011, which may be a cathode ray tube (CRT), or a thin film transistor (TFT) display. The system 1000 may also include a printer controller 1012 for communicating with a printer 1013. A communications controller 1014 may interface with one or more communication devices 1015 which enables the system 1000 to connect to remote devices through any of a variety of networks including the Internet, a local area network (LAN), a wide area network (WAN), or through any suitable electromagnetic carrier signals including infrared signals.

In the illustrated system, all major system components may connect to a bus 1016, which may represent more than one physical bus. However, various system components may or may not be in physical proximity to one another. For example, input data and/or output data may be remotely transmitted from one physical location to another. In addition, programs that implement various aspects of this invention may be accessed from a remote location (e.g., a server) over a network. Such data and/or programs may be conveyed through any of a variety of machine-readable medium including magnetic tape or disk or optical disc, or a transmitter, receiver pair.

The present invention may be conveniently implemented with software. However, alternative implementations are certainly possible, including a hardware implementation or a software/hardware implementation. Any hardware-implemented functions may be realized using ASIC(s), digital signal processing circuitry, or the like. Accordingly, the “means” terms in the claims are intended to cover both software and hardware implementations. Similarly, the term “computer-readable medium” as used herein includes software and or hardware having a program of instructions embodied thereon, or a combination thereof. With these implementation alternatives in mind, it is to be understood that the figures and accompanying description provide the functional information one skilled in the art would require to write program code (i.e., software) or to fabricate circuits (i.e., hardware) to perform the processing required.

In accordance with further aspects of the invention, any of the above-described methods or steps thereof may be embodied in a program of instructions (e.g., software), which may be stored on, or conveyed to, a computer or other processor-controlled device for execution on a computer readable medium. Alternatively, any of the methods or steps thereof may be implemented using functionally equivalent hardware (e.g., application specific integrated circuit (ASIC), digital signal processing circuitry, etc.) or a combination of software and hardware.

While the invention has been described in conjunction with several specific embodiments, it is evident to those skilled in the art that many further alternatives, modifications, and variations will be apparent in light of the foregoing description. Thus, the invention described herein is intended to embrace all such alternatives, modifications, applications and variations as may fall within the spirit and scope of the appended claims.

APPENDIX $\begin{matrix} {{{\rho_{1}\frac{D{\overset{\rightharpoonup}{u}}_{1}}{Dt}} = {{- {\nabla p_{1}}} + {\nabla{\cdot \left( {2\mu_{1}D_{1}} \right)}} + {\nabla{\cdot \tau_{1}}}}},\mspace{40mu}{{\nabla{\cdot {\overset{\rightharpoonup}{u}}_{1}}} = 0},} \\ {\frac{D\;\tau_{1}}{Dt} = {{\tau_{1} \cdot \left( {\nabla{\overset{\rightharpoonup}{u}}_{1}} \right)} + {\left( {\nabla{\overset{\rightharpoonup}{u}}_{1}} \right)^{T} \cdot \tau_{1}} - {\frac{1}{\lambda_{1}}\left( {\tau_{1} - {2\mu_{p\; 1}D_{1}}} \right)}}} \end{matrix}$ (4) ${{\rho_{2}\frac{D{\overset{\rightharpoonup}{u}}_{2}}{Dt}} = {{- {\nabla p_{2}}} + {\nabla{\cdot \left( {2\mu_{2}D_{2}} \right)}}}},\mspace{31mu}{{\nabla{\cdot {\overset{\rightharpoonup}{u}}_{2}}} = 0}$ (5) $\begin{matrix} {{D_{i} = {\frac{1}{2}\left\lbrack {{\nabla{\overset{\rightharpoonup}{u}}_{i}} + \left( {\nabla{\overset{\rightharpoonup}{u}}_{i}} \right)^{T}} \right\rbrack}},\mspace{31mu}{i = 1},2} \\ {{{\overset{\rightharpoonup}{u}}_{i} = {{u_{i}{\hat{e}}_{r}} + {\upsilon_{i}{\hat{e}}_{z}}}},\mspace{25mu}{i = 1},2} \\ {s = {\frac{\mu_{p\; 1}}{\lambda_{1}}\left\lbrack {{\nabla{\overset{\rightharpoonup}{u}}_{i}} + \left( {\nabla{\overset{\rightharpoonup}{u}}_{i}} \right)^{T}} \right\rbrack}} \end{matrix}$ (6) (2μ₁D₁ − 2μ₂D₂) ⋅ n̂ = (p₁ − p₂ + σκ)n̂ (7) ${\varphi\left( {r,z,t} \right)}\left\{ \begin{matrix} {{< {0\mspace{14mu}{if}\mspace{14mu}\left( {r,z} \right)}} \in {{The}\mspace{14mu}{first}\mspace{14mu}{fluid}}} \\ {= {{0\mspace{14mu}{if}\mspace{14mu}\left( {r,z} \right)} \in {{The}\mspace{14mu}{interface}}}} \\ {{> {0\mspace{14mu}{if}\mspace{14mu}\left( {r,z} \right)}} \in {{The}\mspace{14mu}{second}\mspace{14mu}{fluid}}} \end{matrix} \right.$ (8) $\begin{matrix} {{\hat{n} = \frac{\nabla\phi}{{\nabla\phi}}}}_{\phi = 0} \\ {{\kappa = {\nabla{\cdot \left( \frac{\nabla\phi}{{\nabla\phi}} \right)}}}}_{\phi = 0} \end{matrix}$ (9) $\overset{\rightharpoonup}{u} = \left\{ {{\begin{matrix} {{\overset{\rightharpoonup}{u}}_{1},{\phi > 0}} \\ {{\overset{\rightharpoonup}{u}}_{2},{\phi < 0},} \end{matrix}\tau} = \left\{ {{\begin{matrix} {\tau_{1},{\phi > 0}} \\ {0,{\phi < 0},} \end{matrix}p} = \left\{ {{\begin{matrix} {p_{1},{\phi > 0}} \\ {p_{2},{\phi < 0},} \end{matrix}D} = \left\{ \begin{matrix} {D_{1},{\phi > 0}} \\ {D_{2},{\phi < 0}} \end{matrix} \right.} \right.} \right.} \right.$ (10) ${\nabla{\cdot \overset{\rightharpoonup}{u}}} = 0$ (11) ${{\rho(\phi)}\frac{D\overset{\rightharpoonup}{u}}{Dt}} = {{- {\nabla p}} + {\nabla{\cdot \left( {2{\mu(\phi)}D} \right)}} + {\nabla{\cdot \tau}} - {{{\sigma\kappa}(\phi)}{\delta(\phi)}{\nabla\phi}}}$ (12) $\frac{D\tau}{Dt} = {{\tau \cdot \left( {\nabla\overset{\rightharpoonup}{u}} \right)} + {\left( {\nabla\overset{\rightharpoonup}{u}} \right)^{T} \cdot \tau} - {\frac{1}{\lambda(\phi)}\left( {\tau - {2{\mu_{p}(\phi)}D}} \right)}}$ $s = {{\frac{2\mu_{p}}{\lambda(\phi)}D} = {\frac{\mu_{p}}{\lambda(\phi)}\left\lbrack {{\nabla\overset{\rightharpoonup}{u}} + \left( {\nabla\overset{\rightharpoonup}{u}} \right)^{T}} \right\rbrack}}$ (13) ${\rho(\phi)} = \left\{ {{\begin{matrix} \rho_{1} & {{{if}\mspace{14mu}\phi} \geq 0} \\ \rho_{2} & {{{{if}\mspace{14mu}\phi} < 0},} \end{matrix}\mspace{20mu}{\mu(\phi)}} = \left\{ {{\begin{matrix} \mu_{1} & {{{if}\mspace{14mu}\phi} \geq 0} \\ \mu_{2} & {{{{if}\mspace{14mu}\phi} < 0},} \end{matrix}{\lambda(\phi)}} = \left\{ {{\begin{matrix} \lambda_{1} & {{{if}\mspace{14mu}\phi} \geq 0} \\ 0 & {{{{if}\mspace{14mu}\phi} < 0},} \end{matrix}\mspace{20mu}{\mu_{p}(\phi)}} = \left\{ \begin{matrix} \mu_{p\; 1} & {{{if}\mspace{14mu}\phi} \geq 0} \\ 0 & {{{if}\mspace{14mu}\phi} < 0.} \end{matrix} \right.} \right.} \right.} \right.$ (14) ${x = {Lx}^{\prime}},\mspace{20mu}{y = {Ly}^{\prime}},\mspace{25mu}{t = {\frac{L}{U}t^{\prime}}},{p = {\rho_{1}U^{2}p^{\prime}}},\mspace{20mu}{\overset{\rightharpoonup}{u} = {U{\overset{\rightharpoonup}{u}}^{\prime}}},\mspace{14mu}{\tau = {\rho_{1}U^{2}\tau^{\prime}}},{\rho = {\rho_{1}\rho^{\prime}}},\mspace{25mu}{\mu = {\mu_{1}\mu^{\prime}}},\mspace{20mu}{\lambda = {\frac{L}{U}\lambda^{\prime}}},\mspace{14mu}{\mu_{P} = {\mu_{1}\mu_{P}^{\prime}}},$ (15) ${\nabla{\cdot \overset{\rightharpoonup}{u}}} = 0$ (16) $\frac{D\overset{\rightharpoonup}{u}}{Dt} = {{{- \frac{1}{\rho(\phi)}}{\nabla p}} + {\frac{1}{{\rho(\phi)}{Re}}{\nabla{\cdot \left( {2{\mu(\phi)}D} \right)}}} - {\frac{1}{{\rho(\phi)}{We}}{\kappa(\phi)}{\delta(\phi)}{\nabla\phi}} + {\nabla{\cdot \tau}}}$ (17) $\frac{D\tau}{Dt} = {{\tau \cdot \left( {\nabla\overset{\rightharpoonup}{u}} \right)} + {\left( {\nabla\overset{\rightharpoonup}{u}} \right)^{T} \cdot \tau} - {\frac{1}{\lambda(\phi)}\left( {\tau - {2\mspace{11mu}\frac{\mu_{p}(\phi)}{{Re}_{p}}D}} \right)}}$ (18) ${\rho(\phi)} = \left\{ {{\begin{matrix} 1 & {{{if}\mspace{14mu}\phi} \geq 0} \\ {\rho_{2}/\rho_{1}} & {{{if}\mspace{14mu}\phi} < 0} \end{matrix}\mu(\phi)} = \left\{ {{\begin{matrix} 1 & {{{if}\mspace{14mu}\phi} \geq 0} \\ {\mu_{2}/\mu_{1}} & {{{if}\mspace{14mu}\phi} < 0} \end{matrix}\lambda(\phi)} = \left\{ \begin{matrix} 1 & {{{if}\mspace{14mu}\phi} \geq 0} \\ 0 & {{{if}\mspace{14mu}\phi} < 0} \end{matrix} \right.} \right.} \right.$ (19) ${Re} = \frac{\rho_{1}{UL}}{\mu_{1}}$ ${We} = \frac{\rho_{1}U^{2}L}{\sigma}$ ${Re}_{p} = \frac{\rho_{1}{UL}}{\mu_{p\; 1}}$ ${\frac{\partial\phi}{\partial t} + {\overset{\rightharpoonup}{u} \cdot {\nabla\phi}}} = 0$ (20) $\overset{\rightharpoonup}{u} = {\overset{\rightharpoonup}{u}}^{BC}$ (21) ${p = p^{BC}},{\frac{\partial\overset{\rightharpoonup}{u}}{\partial\hat{n}} = 0}$ (22) ${\overset{\rightharpoonup}{u}}^{n} = {\overset{\rightharpoonup}{u}\left( {t = {n\;{\Delta t}}} \right)}$ (23) $\phi^{n + 1} = {\phi^{n} - {{\Delta t}\left\lbrack {\overset{\rightharpoonup}{u} \cdot {\nabla\phi}} \right\rbrack}^{n + {1/2}}}$ (24) $\phi^{n + {1/2}} = {\frac{1}{2}\left( {\phi^{n} + \phi^{n + 1}} \right)}$ (25) $\left. {{\frac{{\overset{\rightharpoonup}{u}}^{n + 1} - {\overset{\rightharpoonup}{u}}^{n}}{\Delta t} + \left\lbrack {\left( {\overset{\rightharpoonup}{u} \cdot \nabla} \right)\overset{\rightharpoonup}{u}} \right\rbrack^{n + {1/2}}} = {{{- \frac{1}{\rho\left( \phi^{n + {1/2}} \right)}}{\nabla p^{n + 1}}} + {\frac{1}{{\rho\left( \phi^{n + {1/2}} \right)}{Re}}{\nabla{\cdot \text{[}}}2{\mu\left( \phi^{n + {1/2}} \right)}D^{n}}}} \right\rbrack + \mspace{160mu}{\nabla{\cdot \tau^{n}}} - {\frac{1}{{\rho\left( \phi^{n + {1/2}} \right)}{We}}\left\lbrack {{\kappa(\phi)}{\delta(\phi)}{\nabla\phi}} \right\rbrack}^{n + {1/2}}$ (26) ${\overset{\rightharpoonup}{u}}^{*} = {{\overset{\rightharpoonup}{u}}^{n} + {{\Delta t}\left\{ {{- \left\lbrack {\left( {\overset{\rightharpoonup}{u} \cdot \nabla} \right)\overset{\rightharpoonup}{u}} \right\rbrack^{n + {1/2}}} + {\frac{1}{{\rho\left( \phi^{n + {1/2}} \right)}{Re}}{\nabla{\cdot \left\lbrack {2{\mu\left( \phi^{n + {1/2}} \right)}D^{n}} \right\rbrack}}\mspace{371mu}{\nabla{\cdot \tau^{n}}}} - {\frac{1}{{\rho\left( \phi^{n + {1/2}} \right)}{We}}\left\lbrack {{\kappa(\phi)}{\delta(\phi)}{\nabla\phi}} \right\rbrack}^{n + {1/2}}} \right\}}}$ (27) ${\overset{\rightharpoonup}{u}}^{n + 1} = {{\overset{\rightharpoonup}{u}}^{*} - {\frac{\Delta t}{\rho\left( \phi^{n + {1/2}} \right)}{\nabla p^{n + 1}}}}$ (28) ${\nabla{\cdot {\overset{\rightharpoonup}{u}}^{*}}} = {\nabla{\cdot \left( {\frac{\Delta t}{\rho\left( \phi^{n + {1/2}} \right)}{\nabla p^{n + 1}}} \right)}}$ (29) ${\int_{\Omega}{{{\overset{\rightharpoonup}{u}}^{*} \cdot {\nabla\psi}}{\mathbb{d}x}}} = {{\int_{\Omega}{\frac{\Delta t}{\rho\left( \phi^{n + {1/2}} \right)}{{\nabla p^{n + 1}} \cdot {\nabla\psi}}{\mathbb{d}x}}} + {\int_{\Gamma_{1}}{\psi{{\overset{\rightharpoonup}{u}}^{BC} \cdot \hat{n}}{\mathbb{d}S}}}}$ (30) ${\frac{\Delta t}{\rho\left( \phi^{n + {1/2}} \right)}\frac{\partial p^{n + 1}}{\partial\hat{n}}} = {\left( {{\overset{\rightharpoonup}{u}}^{*} - {\overset{\rightharpoonup}{u}}^{BC}} \right) \cdot \hat{n}}$ (31) ${\overset{\rightharpoonup}{u}}^{n + 1} = {\left( {{\overset{\rightharpoonup}{u}}^{n} + {\overset{\rightharpoonup}{u}}^{n + 1}} \right)/2}$ (32) $\frac{\tau^{n + 1} - \tau^{n}}{\Delta t} = {{{- \left( {{\overset{\rightharpoonup}{u}}^{n + {1/2}} \cdot \nabla} \right)}\tau^{n}} + {\tau^{n} \cdot \left( {\nabla{\overset{\rightharpoonup}{u}}^{n + {1/2}}} \right)} + {\left( {\nabla{\overset{\rightharpoonup}{u}}^{n + {1/2}}} \right)^{T} \cdot \tau^{n}} - {\frac{1}{\lambda\left( \phi^{n + {1/2}} \right)}\left( {\tau^{n + 1} - {2\frac{\mu_{p}\left( \phi^{n + {1/2}} \right)}{{Re}_{p}}D^{n + {1/2}}}} \right)}}$ (33) ${\left( {1 + \frac{\Delta t}{\lambda_{p}\left( \phi^{n + {1/2}} \right)}} \right)\tau^{n + 1}} = {\tau^{n} + {{\Delta t}\left\lbrack {{{- \left( {{\overset{\rightharpoonup}{u}}^{n + {1/2}} \cdot \nabla} \right)}\tau^{n}} + {\tau^{n} \cdot \left( {\nabla{\overset{\rightharpoonup}{u}}^{n + {1/2}}} \right)} + {\left( {\nabla{\overset{\rightharpoonup}{u}}^{n + {1/2}}} \right)^{T} \cdot \tau^{n}}} \right\rbrack} + {\frac{2{{\Delta t\mu}_{p}\left( \phi^{n + {1/2}} \right)}}{{\lambda\left( \phi^{n + {1/2}} \right)}{Re}_{p}}D^{n + {1/2}}}}$ (34) $\left\lbrack {\left( {\overset{\rightharpoonup}{u} \cdot \nabla} \right)\overset{\rightharpoonup}{u}} \right\rbrack_{i,j}^{n + {1/2}} = {{\frac{u_{{i + {1/2}},j}^{n + {1/2}} + u_{{i - {1/2}},j}^{n + {1/2}}}{2}\frac{u_{{i + {1/2}},j}^{n + {1/2}} - u_{{i - {1/2}},j}^{n + {1/2}}}{\Delta r}} + \mspace{194mu}{\frac{{v\;}_{i,{j + {1/2}}}^{n + {1/2}} + v_{i,{j - {1/2}}}^{n + {1/2}}}{2}\frac{u_{i,{j + {1/2}}}^{n + {1/2}} - u_{i,{j - {1/2}}}^{n + {1/2}}}{\Delta z}}}$ (35) $\left\lbrack {\left( {\overset{\rightharpoonup}{u} \cdot \nabla} \right)\phi} \right\rbrack_{i,j}^{n + {1/2}} = {{\frac{u_{{i + {1/2}},j}^{n + {1/2}} + u_{{i - {1/2}},j}^{n + {1/2}}}{2}\frac{\phi_{{i + {1/2}},j}^{n + {1/2}} - \phi_{{i - {1/2}},j}^{n + {1/2}}}{\Delta r}} + \mspace{194mu}{\frac{{v\;}_{i,{j + {1/2}}}^{n + {1/2}} + v_{i,{j - {1/2}}}^{n + {1/2}}}{2}\frac{\phi_{i,{j + {1/2}}}^{n + {1/2}} - \phi_{i,{j - {1/2}}}^{n + {1/2}}}{\Delta z}}}$ (36) $\begin{matrix} {{\overset{\rightharpoonup}{u}}_{{i + {1/2}},j}^{{n + {1/2}},L} = {{\overset{\rightharpoonup}{u}}_{i,j}^{n} + {\frac{\Delta r}{2}{\overset{\rightharpoonup}{u}}_{r,i,j}^{n}} + {\frac{\Delta t}{2}{\overset{\rightharpoonup}{u}}_{t,i,j}^{n}}}} \\ {= {{\overset{\rightharpoonup}{u}}_{i,j}^{n} + {\frac{1}{2}\left( {{\Delta r} - {{\Delta t}{\overset{\rightharpoonup}{u}}_{i,j}^{n}}} \right){\overset{\rightharpoonup}{u}}_{r,i,j}^{n}} - {\frac{\Delta t}{2}\left( {\overset{\bullet}{v}{\overset{\rightharpoonup}{u}}_{z}} \right)_{i,j}} + {\frac{\Delta t}{2}F_{i,j}^{n}}}} \end{matrix}\quad$ (37) $F_{i,j}^{n} = \left\lbrack {{{- \frac{1}{\rho(\phi)}}{\nabla p}} + {\frac{1}{{\rho(\phi)}{Re}}{\nabla{\cdot \left( {2{\mu(\phi)}D} \right)}}} + {\nabla{\cdot \tau}} - {\frac{1}{{\rho(\phi)}{We}}{\kappa(\phi)}{\delta(\phi)}{\nabla\phi}}} \right\rbrack_{i,j}^{n}$ (38) $\begin{matrix} {{\overset{\rightharpoonup}{u}}_{{i + {1/2}},j}^{{n + {1/2}},R} = {{\overset{\rightharpoonup}{u}}_{{i + 1},j}^{n} - {\frac{\Delta r}{2}{\overset{\rightharpoonup}{u}}_{r,{i + 1},j}^{n}} + {\frac{\Delta t}{2}{\overset{\rightharpoonup}{u}}_{t,{i + 1},j}^{n}}}} \\ {= {{\overset{\rightharpoonup}{u}}_{{i + 1},j}^{n} - {\frac{1}{2}\left( {{\Delta r} + {{\Delta t}{\overset{\rightharpoonup}{u}}_{{i + 1},j}^{n}}} \right){\overset{\rightharpoonup}{u}}_{r,{i + 1},j}^{n}} - {\frac{\Delta t}{2}\left( {\overset{\bullet}{v}{\overset{\rightharpoonup}{u}}_{z}} \right)_{{i + 1},j}} + {\frac{\Delta t}{2}F_{{i + 1},j}^{n}}}} \end{matrix}\quad$ (39) $u_{{i + {1/2}},j}^{n + {1/2}} = \left\{ {\begin{matrix} \begin{matrix} u_{{i + {1/2}},j}^{{n + {1/2}},L} \\ u_{{i + {1/2}},j}^{{n + {1/2}},R} \end{matrix} \\ 0 \end{matrix}\begin{matrix} \begin{matrix} {{{if}\mspace{14mu} u_{{i + {1/2}},j}^{{n + {1/2}},L}} > {{0\mspace{14mu}{and}\mspace{14mu} u_{{i + {1/2}},j}^{{n + {1/2}},L}} + u_{{i + {1/2}},j}^{{n + {1/2}},R}} > 0} \\ {{{if}\mspace{14mu} u_{{i + {1/2}},j}^{{n + {1/2}},R}} < {{0\mspace{14mu}{and}\mspace{14mu} u_{{i + {1/2}},j}^{{n + {1/2}},R}} + u_{{i + {1/2}},j}^{{n + {1/2}},R}} < 0} \end{matrix} \\ {otherwise} \end{matrix}} \right.$ (40) $u_{{i + {1/2}},j}^{n + {1/2}} = \left\{ \begin{matrix} v_{{i + {1/2}},j}^{{n + {1/2}},L} & {{{if}\mspace{14mu} u_{{i + {1/2}},j}^{n + {1/2}}} > 0} \\ v_{{i + {1/2}},j}^{{n + {1/2}},R} & {{{if}\mspace{14mu} u_{{i + {1/2}},j}^{n + {1/2}}} < 0} \\ \frac{v_{{i + {1/2}},j}^{{n + {1/2}},L} + v_{{i + {1/2}},j}^{{n + {1/2}},R}}{2} & {{{if}\mspace{14mu} u_{{i + {1/2}},j}^{n + {1/2}}} = 0} \end{matrix} \right.$ (41) $\phi_{{i + {1/2}},j}^{n + {1/2}} = \left\{ \begin{matrix} \phi_{{i + {1/2}},j}^{{n + {1/2}},L} & {{{if}\mspace{14mu} u_{{i + {1/2}},j}^{n + {1/2}}} > 0} \\ \phi_{{i + {1/2}},j}^{{n + {1/2}},R} & {{{if}\mspace{14mu} u_{{i + {1/2}},j}^{n + {1/2}}} < 0} \\ \frac{\phi_{{i + {1/2}},j}^{{n + {1/2}},L} + \phi_{{i + {1/2}},j}^{{n + {1/2}},R}}{2} & {{{if}\mspace{14mu} u_{{i + {1/2}},j}^{n + {1/2}}} = 0} \end{matrix} \right.$ ${\overset{\rightharpoonup}{u}}^{e} - {\frac{1}{\rho\left( \phi^{n} \right)}{\nabla q}}$ (42) ${\nabla{\cdot \left( {\frac{1}{\rho\left( \phi^{n} \right)}{\nabla q}} \right)}} = {\nabla{\cdot {\overset{\rightharpoonup}{u}}^{e}}}$ (43) ${{\frac{\partial}{\partial r}\left( {\frac{r}{\rho(\phi)}\frac{\partial q}{\partial r}} \right)} + {\frac{\partial}{\partial z}\left( {\frac{r}{\rho(\phi)}\frac{\partial q}{\partial r}} \right)}} = {{\frac{\partial}{\partial r}\left( {ru}^{e} \right)} + {\frac{\partial}{\partial r}\left( {rv}^{e} \right)}}$ (44) ${{\frac{1}{{\Delta r}^{2}}\left\lbrack {{\frac{r_{{i + {1/2}},j}}{\left( {\rho(\phi)} \right)_{{i + {1/2}},j}}\left( {q_{{i + 1},j} - q_{i,j}} \right)} - {\frac{r_{{i - {1/2}},j}}{\left( {\rho(\phi)} \right)_{{i - {1/2}},j}}\left( {q_{i,j} - q_{{i - 1},j}} \right)}} \right\rbrack} + {\frac{r_{i,j}}{{\Delta z}^{2}}\left\lbrack {{\frac{1}{\left( {\rho(\phi)} \right)_{i,{j + {1/2}}}}\left( {q_{i,{j + 1}} - q_{i,j}} \right)} - {\frac{1}{\left( {\rho(\phi)} \right)_{i,{j - {1/2}}}}\left( {q_{i,j} - q_{i,{j - 1}}} \right)}} \right\rbrack}} = \mspace{85mu}{\frac{{r_{{i + {1/2}},j}u_{{i + {1/2}},j}^{n + {1/2}}} - {r_{{i - {1/2}},j}u_{{i - {1/2}},j}^{n + {1/2}}}}{\Delta r} + \frac{r_{i,j}\left( {v_{i,{j + {1/2}}}^{n + {1/2}} - v_{i,{j - {1/2}}}^{n + {1/2}}} \right)}{\Delta z}}$ (45) $q = {\frac{\Delta t}{2}{\Delta p}^{boundary}}$ (46) $\left. u_{{i + {1/2}},j}^{n + {1/2}}\leftarrow{u_{{i + {1/2}},j}^{n + {1/2}} - {\frac{1}{\left( {\rho(\phi)} \right)_{{i + {1/2}},j}}\frac{q_{{i + 1},j} - q_{i,j}}{\Delta r}}} \right.$ $\left. v_{i,{j + {1/2}}}^{n + {1/2}}\leftarrow{v_{i,{j + {1/2}}}^{n + {1/2}} - {\frac{1}{\left( {\rho(\phi)} \right)_{i,{j + {1/2}}}}\frac{q_{i,{j + 1}} - q_{i,j}}{\Delta z}}} \right.$ (47) $D_{r,i,j}^{c} = {\left( {{\overset{\rightharpoonup}{u}}_{{i + 1},j} - {\overset{\rightharpoonup}{u}}_{{i - 1},j}} \right)/2}$ $D_{r,i,j}^{+} = {{\overset{\rightharpoonup}{u}}_{{i + 1},j} - {\overset{\rightharpoonup}{u}}_{i,j}}$ $D_{r,i,j}^{c} = {{\overset{\rightharpoonup}{u}}_{i,j} - {\overset{\rightharpoonup}{u}}_{{i - 1},j}}$ (48) $\delta_{\lim,i,j} = \left\{ \begin{matrix} {\min\left( {{2{D_{r,i,j}^{-}}},{2{D_{r,i,j}^{+}}}} \right)} & {{{if}\mspace{14mu} D_{r,i,j}^{-} \times D_{r,i,j}^{+}} > 0} \\ 0 & {otherwise} \end{matrix} \right.$ (49) δ_(f, i, j) = min (D_(r, i, j)^(c), δ_(lim , i, j)) × sign(D_(r, i, j)^(c)) (50) $\delta_{r,i,j}^{4} = {{\min\left( \mspace{11mu}{{{\frac{4D_{r,i,j}^{c}}{3} - \frac{\delta_{f,i,j} + \delta_{f,i,j}}{6}}},\delta_{\lim,i,j}} \right)} \times {{sign}\left( D_{r,i,j}^{c} \right)}}$ (51) u_(r, i, j) = δ_(r, i, j)⁴/Δr (52) $\left( {\overset{\bullet}{v}{\overset{\rightharpoonup}{u}}_{z}} \right)_{i,j} = {\frac{{\hat{v}}_{i,{j + {1/2}}}^{adv} + {\hat{v}}_{i,{j - {1/2}}}^{adv}}{2}\frac{{\hat{u}}_{i,{j + {1/2}}} - {\hat{u}}_{i,{j - {1/2}}}}{\Delta z}}$ (53) ${\hat{u}}_{i,{j + {1/2}}}^{B} = {{\overset{\rightharpoonup}{u}}_{i,j}^{n} + {\frac{1}{2}\left( {{\Delta z} - {\Delta tv}_{i,j}^{n}} \right){\overset{\rightharpoonup}{u}}_{z,i,j}^{n}}}$ ${\hat{u}}_{i,{j + {1/2}}}^{T} = {{\overset{\rightharpoonup}{u}}_{i,{j + 1}}^{n} - {\frac{1}{2}\left( {{\Delta z} + {\Delta tv}_{i,{j + 1}}^{n}} \right){\overset{\rightharpoonup}{u}}_{z,i,{j + 1}}^{n}}}$ (54) ${\hat{v}}_{i,{j + {1/2}}}^{adv} = \left\{ {\begin{matrix} \begin{matrix} {\hat{v}}_{i,{j + {1/2}}}^{B} \\ {\hat{v}}_{i,{j + {1/2}}}^{T} \end{matrix} \\ 0 \end{matrix}\begin{matrix} \begin{matrix} {{{if}\mspace{14mu}{\hat{v}}_{i,{j + {1/2}}}^{B}} > {{0\mspace{14mu}{and}\mspace{14mu}{\hat{v}}_{i,{j + {1/2}}}^{B}} + {\hat{v}}_{i,{j + {1/2}}}^{T}} > 0} \\ {{{if}\mspace{14mu}{\hat{v}}_{i,{j + {1/2}}}^{T}} < {{0\mspace{14mu}{and}\mspace{14mu}{\hat{v}}_{i,{j + {1/2}}}^{B}} + {\hat{v}}_{i,{j + {1/2}}}^{T}} < 0} \end{matrix} \\ {otherwise} \end{matrix}} \right.$ (55) ${\hat{u}}_{i,{j + {1/2}}} = \left\{ \begin{matrix} {\hat{u}}_{i,{j + {1/2}}}^{B} & {{{if}\mspace{14mu}{\hat{v}}_{i,{j + {1/2}}}^{adv}} > 0} \\ {\hat{u}}_{i,{j + {1/2}}}^{T} & {{{if}\mspace{14mu}{\hat{v}}_{i,{j + {1/2}}}^{adv}} < 0} \\ \frac{{\hat{u}}_{i,{j + {1/2}}}^{B} + {\hat{u}}_{i,{j + {1/2}}}^{T}}{2} & {{{if}\mspace{14mu}{\hat{v}}_{i,{j + {1/2}}}^{adv}} = 0} \end{matrix} \right.$ (56) ${\left( {{\overset{\rightharpoonup}{u}}^{n + {1/2}} \cdot \nabla} \right)\tau^{n}} = {{{\max\left( {u_{i,j}^{n + {1/2}},0} \right)}\mspace{11mu}\frac{\tau_{i,j}^{n} - \tau_{{i - 1},j}^{n}}{\Delta x}} + {{\min\left( {u_{i,j}^{n + {1/2}},0} \right)}\;\frac{\tau_{{i + 1},j}^{n} - \tau_{i,j}^{n}}{\Delta x}} + {{\max\left( {v_{i,j}^{n + {1/2}},0} \right)}\;\frac{\tau_{i,j}^{n} - \tau_{i,{j - 1}}^{n}}{\Delta y}} + \mspace{329mu}{{\min\left( {v_{i,j}^{n + {1/2}},0} \right)}\;\frac{\tau_{i,{j + 1}}^{n} - \tau_{i,j}^{n}}{\Delta y}}}$ (57) ${H(\phi)} = \left\{ \begin{matrix} 0 & {{{if}\mspace{14mu}\phi} < {- ɛ}} \\ {\frac{1}{2}\left\lbrack {1 + \frac{\phi}{ɛ} + {\frac{1}{\pi}{\sin\left( \frac{\pi\phi}{ɛ} \right)}}} \right\rbrack} & {{{if}\mspace{14mu}{\phi }} \leq ɛ} \\ 1 & {{{if}\mspace{14mu}\phi} > {ɛ.}} \end{matrix} \right.$ (58) ${\delta(\phi)} = \frac{{dH}(\phi)}{d\;\phi}$ (59) $ɛ = {\frac{\alpha}{2}\left( {{\Delta r} + {\Delta z}} \right)}$ (60) ${\Delta t} < {\min\limits_{i,j}\left\lbrack {\frac{\Delta r}{{u} + \sqrt{2\left( {\tau_{rr} + {1/{\lambda Re}}} \right.}},\frac{\Delta z}{{v} + \sqrt{2\left( {\tau_{zz} + {1/{\lambda Re}}} \right.}},{\sqrt{{We}\;\frac{\rho_{1} + \rho_{2}}{8\pi}}h^{3/2}},{\frac{Re}{2}\frac{\rho^{n}}{\mu^{n}}\left( {\frac{1}{{\Delta r}^{2}} + \frac{1}{{\Delta z}^{2}}} \right)^{- 1}},\sqrt{\frac{2h}{F}}} \right\rbrack}$ (61) ${\frac{{\overset{\rightharpoonup}{u}}^{n + 1} - {\overset{\rightharpoonup}{u}}^{n}}{\Delta t} + \left\lbrack {\left( {\overset{\rightharpoonup}{u} \cdot \nabla} \right)\overset{\rightharpoonup}{u}} \right\rbrack^{n + {1/2}}} = {{{- \frac{1}{\rho\left( \phi^{n + {1/2}} \right)}}{\nabla_{p}^{n + {1/2}}{+ \frac{1}{{\rho\left( \phi^{n + {1/2}} \right)}{Re}}}}{\nabla{\cdot \mspace{14mu}\left\lbrack {2{\mu\left( \phi^{n + {1/2}} \right)}D^{n + {1/2}}} \right\rbrack}}} + {\nabla{\cdot \tau^{n + {1/2}}}} - {\frac{1}{{\rho\left( \phi^{n + {1/2}} \right)}{We}}\left\lbrack {{\kappa(\phi)}{\delta(\phi)}{\nabla\phi}} \right\rbrack}^{n + {1/2}}}$ (62) ${\nabla{\cdot {\overset{\rightharpoonup}{u}}^{n + 1}}} = 0$ $D^{n + {1/2}} = {{\frac{1}{2}\left( {D^{n} + D^{n + 1}} \right)} = {\frac{1}{2}\left( {{\frac{1}{2}\left\lbrack {{\nabla\overset{\rightharpoonup}{u}} + \left( {\nabla\overset{\rightharpoonup}{u}} \right)^{T}} \right\rbrack}^{n} + {\frac{1}{2}\left\lbrack {{\nabla\overset{\rightharpoonup}{u}} + \left( {\nabla\overset{\rightharpoonup}{u}} \right)^{T}} \right\rbrack}^{n + 1}} \right)}}$ (63) ${\overset{\rightharpoonup}{u}}^{**} = {{\overset{\rightharpoonup}{u}}^{n} + {{\Delta t}\left\lbrack {{- \left\lbrack {\left( {\overset{\rightharpoonup}{u} \cdot \nabla} \right)\overset{\rightharpoonup}{u}} \right\rbrack^{n + {1/2}}} - {\frac{1}{\rho\left( \phi^{n + {1/2}} \right)}{\nabla p^{n - {1/2}}}} + {\nabla{\cdot \tau^{n + {1/2}}}} + {\frac{1}{{\rho\left( \phi^{n + {1/2}} \right)}{Re}}{\nabla{\cdot \;\left\lbrack {{\mu\left( \phi^{n + {1/2}} \right)}D^{n}} \right\rbrack}}} - {\frac{1}{{\rho\left( \phi^{n + {1/2}} \right)}{We}}\left\lbrack {{\kappa(\phi)}{\delta(\phi)}{\nabla\phi}} \right\rbrack}^{n + {1/2}}} \right\rbrack}}$ (64) ${{\overset{\rightharpoonup}{u}}^{*} - {\frac{\Delta t}{{\rho\left( \phi^{n + {1/2}} \right)}{Re}}{\nabla{\cdot \;\left\lbrack {{\mu\left( \phi^{n + {1/2}} \right)}D^{*}} \right\rbrack}}}} = {\overset{\rightharpoonup}{u}}^{**}$ (65) $D^{*} = {\frac{1}{2}\left\lbrack {{\nabla{\overset{\rightharpoonup}{u}}^{*}} + \left( {\nabla{\overset{\rightharpoonup}{u}}^{*}} \right)^{T}} \right\rbrack}$ (66) $\left. {\overset{\rightharpoonup}{u}}^{*}\leftarrow{{\overset{\rightharpoonup}{u}}^{*} + {\frac{\Delta t}{\rho\left( \phi^{n + {1/2}} \right)}{\nabla p^{n - {1/2}}}}} \right.$ (67) ${\overset{\rightharpoonup}{u}}^{n + 1} = {{\overset{\rightharpoonup}{u}}^{*} - {\frac{\Delta t}{\rho\left( \phi^{n + {1/2}} \right)}{\nabla p^{n + 1}}}}$ (68) ${\nabla{\cdot {\overset{\rightharpoonup}{u}}^{*}}} = {\nabla{\cdot \left( {\frac{\Delta t}{\rho\left( \phi^{n + {1/2}} \right)}{\nabla p^{n + {1/2}}}} \right)}}$ (69) $\frac{\tau^{n + 1} - \tau^{n}}{\Delta t} = {\left\lbrack {{{- \left( {\overset{\rightharpoonup}{u} \cdot \nabla} \right)}\tau} + {\tau \cdot \left( {\nabla\overset{\rightharpoonup}{u}} \right)} + {\left( {\nabla\overset{\rightharpoonup}{u}} \right)^{T} \cdot \tau}} \right\rbrack^{n + {1/2}} - \mspace{160mu}{\frac{1}{\lambda\left( \phi^{n + {1/2}} \right)}\left( {\tau^{n + 1} - {2\;\frac{\mu_{p}\left( \phi^{n + {1/2}} \right)}{{Re}_{p}}D^{n + {1/2}}}} \right)}}$ (70) ${\left( {1 + \frac{\Delta t}{\lambda_{p}\left( \phi^{n + {1/2}} \right)}} \right)\tau^{n + 1}} = {\tau^{n} + {{\Delta t}\left\lbrack {{{- \left( {\overset{\rightharpoonup}{u} \cdot \nabla} \right)}\tau} + {\tau \cdot \left( {\nabla\overset{\rightharpoonup}{u}} \right)} + {\left( {\nabla\overset{\rightharpoonup}{u}} \right)^{T} \cdot \tau}} \right\rbrack}^{n + {1/2}} + {\frac{2{{\Delta t\mu}_{p}\left( \phi^{n + {1/2}} \right)}}{{\lambda\left( \phi^{n + {1/2}} \right)}{Re}_{p}}D^{n + {1/2}}}}$ (71) $\left\lbrack {\left( {\overset{\rightharpoonup}{u} \cdot \nabla} \right)\tau} \right\rbrack_{i,j}^{n + {1/2}} = {{\frac{u_{{i + {1/2}},j}^{n + {1/2}} + u_{{i - {1/2}},j}^{n + {1/2}}}{2}\;\frac{\tau_{{i + {1/2}},j}^{n + {1/2}} - \tau_{{i - {1/2}},j}^{n + {1/2}}}{\Delta r}} + \mspace{200mu}{\frac{v_{i,{j + {1/2}}}^{n + {1/2}} + v_{i,{j - {1/2}}}^{n + {1/2}}}{2}\;\frac{\tau_{i,{j + {1/2}}}^{n + {1/2}} - \tau_{i,{j - {1/2}}}^{n + {1/2}}}{\Delta z}}}$ (72) $\begin{matrix} {\tau_{{i + {1/2}},j}^{{n + {1/2}},L} = {\tau_{i,j}^{n} + {\frac{\Delta r}{2}\tau_{r,i,j}^{n}} + {\frac{\Delta t}{2}\tau_{t,i,j}^{n}}}} \\ {= {\tau_{i,j}^{n} + {\frac{1}{2}\left( {{\Delta r} - {{\Delta t}u}_{i,j}^{n}} \right)\tau_{r,i,j}^{n}} - {\frac{\Delta t}{2}\left( {\hat{v}{\hat{\tau}}_{z}} \right)_{i,j}} + {\frac{\Delta t}{2}G_{i,j}^{n}}}} \end{matrix}\quad$ (73) $G_{i,j}^{n} = \left\lbrack {{\tau \cdot \left( {\nabla\overset{\rightharpoonup}{u}} \right)} + {\left( {\nabla\overset{\rightharpoonup}{u}} \right)^{T} \cdot \tau} - {\frac{1}{\lambda(\phi)}\left( {\tau - {2\;\frac{\mu_{p}(\phi)}{{Re}_{p}}D}} \right)}} \right\rbrack_{i,j}^{n}$ (74) $\begin{matrix} {\tau_{{i + {1/2}},j}^{{n + {1/2}},R} = {\tau_{{i + 1},j}^{n} - {\frac{\Delta r}{2}\tau_{r,{i + 1},j}^{n}} + {\frac{\Delta t}{2}\tau_{t,{i + 1},j}^{n}}}} \\ {= {\tau_{{i + 1},j}^{n} - {\frac{1}{2}\left( {{\Delta r} + {{\Delta t}u}_{{i + 1},j}^{n}} \right)\tau_{r,{i + 1},j}^{n}} - {\frac{\Delta t}{2}\left( {\hat{v}{\hat{\tau}}_{z}} \right)_{{i + 1},j}} + {\frac{\Delta t}{2}G_{{i + 1},j}^{n}}}} \end{matrix}\quad$ (75) $\tau_{{i + {1/2}},j}^{n + {1/2}} = \left\{ \begin{matrix} \tau_{{i + {1/2}},j}^{{n + {1/2}},L} & {{{if}\mspace{14mu} u_{{i + {1/2}},j}^{n + {1/2}}} > 0} \\ \tau_{{i + {1/2}},j}^{{n + {1/2}},R} & {{{if}\mspace{14mu} u_{{i + {1/2}},j}^{n + {1/2}}} < 0} \\ \frac{\tau_{{i + {1/2}},j}^{{n + {1/2}},L} + \tau_{{i + {1/2}},j}^{{n + {1/2}},R}}{2} & {{{if}\mspace{14mu} u_{{i + {1/2}},j}^{n + {1/2}}} = 0} \end{matrix} \right.$ (76) $\;{\left\lbrack {\tau \cdot \left( {\nabla\overset{\rightharpoonup}{u}} \right)} \right\rbrack^{n + {1/2}} = {{\left( {{\frac{\partial u}{\partial r}\tau_{rr}} + {\frac{\partial u}{\partial z}\tau_{rz}}} \right)^{n + {1/2}}{\hat{e}}_{r}{\hat{e}}_{r}} + {\left( {{\frac{\partial v}{\partial r}\tau_{rr}} + {\frac{\partial v}{\partial z}\tau_{rz}}} \right)^{n + {1/2}}{\hat{e}}_{r}{\hat{e}}_{z}} + {\left( {{\frac{\partial u}{\partial r}\tau_{rz}} + {\frac{\partial u}{\partial z}\tau_{zz}}} \right)^{n + {1/2}}{\hat{e}}_{z}{\hat{e}}_{r}} + \mspace{121mu}{\left( {{\frac{\partial v}{\partial r}\tau_{rz}} + {\frac{\partial v}{\partial z}\tau_{zz}}} \right)^{n + {1/2}}{\hat{e}}_{z}{\hat{e}}_{z}} + {\frac{u^{n + {1/2}}}{r}\tau_{\theta\theta}^{n + {1/2}}{\hat{e}}_{\theta}{\hat{e}}_{\theta}}}}$ (77) ${{\frac{\partial u}{\partial r}\tau_{rr}} + {\frac{\partial u}{\partial z}\tau_{rz}}} = {{\frac{u_{{i + {1/2}},j} - u_{{i - {1/2}},j}}{\Delta r}\frac{\tau_{{rr},{i + {1/2}},j} + \tau_{{rr},{i - {1/2}},j} + \tau_{{rr},i,{j + {1/2}}} + \tau_{{rr},i,{j - {1/2}}}}{4}} + \mspace{25mu}{\frac{u_{i,{j + {1/2}}} - u_{i,{j - {1/2}}}}{\Delta z}\frac{\tau_{{rz},{i + {1/2}},j} + \tau_{{rz},{i - {1/2}},j} + \tau_{{rz},i,{j + {1/2}}} + \tau_{{rz},i,{j - {1/2}}}}{4}}}$ (78) $\begin{matrix} {{{{\frac{\partial v}{\partial r}\tau_{rr}} + {\frac{\partial v}{\partial z}\tau_{rz}}} =}\mspace{464mu}} \\ {{\frac{v_{{i + {1/2}},j} - v_{{i - {1/2}},j}}{\Delta r}\;\frac{\tau_{{rr},{i + {1/2}},j} + \tau_{{rr},{i - {1/2}},j} + \tau_{{rr},i,{j + {1/2}}} + \tau_{{rr},i,{j - {1/2}}}}{4}} +} \\ {\mspace{20mu}{\frac{v_{i,{j + {1/2}}} - v_{i,{j - {1/2}}}}{\Delta z}\;\frac{\tau_{{rz},{i + {1/2}},j} + \tau_{{rz},{i - {1/2}},j} + \tau_{{rz},i,{j + {1/2}}} + \tau_{{rz},i,{j - {1/2}}}}{4}}} \end{matrix}\quad$ ${{\frac{\partial u}{\partial r}\tau_{rz}} + {\frac{\partial u}{\partial z}\tau_{zz}}} = {{\frac{u_{{i + {1/2}},j} - u_{{i - {1/2}},j}}{\Delta r}\frac{\tau_{{rz},{i + {1/2}},j} + \tau_{{rz},{i - {1/2}},j} + \tau_{{rz},i,{j + {1/2}}} + \tau_{{rz},i,{j - {1/2}}}}{4}} + \mspace{25mu}{\frac{u_{i,{j + {1/2}}} - u_{i,{j - {1/2}}}}{\Delta z}\frac{\tau_{{zz},{i + {1/2}},j} + \tau_{{zz},{i - {1/2}},j} + \tau_{{zz},i,{j + {1/2}}} + \tau_{{zz},i,{j - {1/2}}}}{4}}}$ $\begin{matrix} {{{{\frac{\partial v}{\partial r}\tau_{rz}} + {\frac{\partial v}{\partial z}\tau_{zz}}} =}\mspace{464mu}} \\ {{\frac{v_{{i + {1/2}},j} - v_{{i - {1/2}},j}}{\Delta r}\;\frac{\tau_{{rz},{i + {1/2}},j} + \tau_{{rz},{i - {1/2}},j} + \tau_{{rz},i,{j + {1/2}}} + \tau_{{rz},i,{j - {1/2}}}}{4}} +} \\ {\mspace{20mu}{\frac{v_{i,{j + {1/2}}} - v_{i,{j - {1/2}}}}{\Delta z}\;\frac{\tau_{{zz},{i + {1/2}},j} + \tau_{{zz},{i - {1/2}},j} + \tau_{{zz},i,{j + {1/2}}} + \tau_{{zz},i,{j - {1/2}}}}{4}}} \end{matrix}\quad$ $\begin{matrix} {{\frac{u}{r}\tau_{\theta\theta}} = {\frac{u_{{i + {1/2}},j} + u_{{i - {1/2}},j} + u_{i,{j + {1/2}}} + u_{i,{j - {1/2}}}}{4r_{i,j}} \times}} \\ \frac{\tau_{{\theta\theta},{i + {1/2}},j} + \tau_{{\theta\theta},{i - {1/2}},j} + \tau_{{\theta\theta},i,{j + {1/2}}} + \tau_{{\theta\theta},i,{j - {1/2}}}}{4} \end{matrix}\quad$ ${\nabla{\cdot \tau^{n + {1/2}}}} = {{\left( {\frac{\partial\tau_{rr}}{\partial r} + \frac{\partial\tau_{rz}}{\partial z} + \frac{\tau_{rr} - \tau_{\theta\theta}}{r}} \right)^{n + {1/2}}{\hat{e}}_{r}} + {\left( {\frac{\partial\tau_{rz}}{\partial r} + \frac{\partial\tau_{zz}}{\partial z} + \frac{\tau_{rz}}{r}} \right)^{n + {1/2}}\;{\hat{e}}_{z}}}$ (79) $\left( \frac{\partial\tau_{rr}}{\partial r} \right)_{i,j}^{n + {1/2}} = {\left( {\tau_{{rr},{i + {1/2}},j}^{n + {1/2}} - \tau_{{rr},{i - {1/2}},j}^{n + {1/2}}} \right)/{\Delta r}}$ (80) $\left( \frac{\partial\tau_{rz}}{\partial z} \right)_{i,j}^{n + {1/2}} = {\left( {\tau_{{rz},i,{j + {1/2}}}^{n + {1/2}} - \tau_{{rz},i,{j - {1/2}}}^{n + {1/2}}} \right)/{\Delta z}}$ $\left( \frac{\partial\tau_{rz}}{\partial r} \right)_{i,j}^{n + {1/2}} = {\left( {\tau_{{rz},{i + {1/2}},j}^{n + {1/2}} - \tau_{{rz},{i - {1/2}},j}^{n + {1/2}}} \right)/{\Delta r}}$ $\left( \frac{\partial\tau_{zz}}{\partial z} \right)_{i,j}^{n + {1/2}} = {\left( {\tau_{{zz},i,{j + {1/2}}}^{n + {1/2}} - \tau_{{zz},i,{j - {1/2}}}^{n + {1/2}}} \right)/{\Delta z}}$ $\left( \frac{\tau_{rr}^{n + {1/2}} - \tau_{\theta\theta}^{n + {1/2}}}{r} \right)_{i,j} = {\frac{\tau_{{rr},{i + {1/2}},j}^{n + {1/2}} + \tau_{{rr},{i - {1/2}},j}^{n + {1/2}} + \tau_{{rr},i,{j + {1/2}}}^{n + {1/2}} + \tau_{{rr},i,{j - {1/2}}}^{n + {1/2}}}{4r_{i,j}} - \mspace{250mu}\frac{\tau_{{\theta\theta},{i + {1/2}},j}^{n + {1/2}} + \tau_{{\theta\theta},{i - {1/2}},j}^{n + {1/2}} + \tau_{{\theta\theta},i,{j + {1/2}}}^{n + {1/2}} + \tau_{{\theta\theta},i,{j - {1/2}}}^{n + {1/2}}}{4r_{i,j}}}$ 

1. A method using a central processing unit to simulate and analyze flow of a viscoelastic fluid through a channel having an interface between a first fluid that flows through the channel and a second fluid, and a formation of a droplet, the method comprising: performing calculations using the central processing unit to solve equations, including a momentum equation, governing a viscoelastic flow of the first fluid through the channel, including viscoelastic stress equations that include a normalized relaxation time up to 1000, the calculations being performed to simulate the flow of the first fluid through the channel, wherein the method is stable over a period of time in which a droplet is formed; and updating, periodically during the simulation using the central processing unit, a level set function for the first and second fluids, wherein the level set function describes a position of the interface between the first and second fluids, and an evolution of the level set function over time describes a shape and the position of the interface over time; wherein each of the performing and updating steps is carried out using a quadrilateral grid finite difference method.
 2. A non-transitory computer readable storage medium encoded with instructions for performing the method recited in claim
 1. 3. A system including the central processing unit and memory configured to perform the method recited in claim
 1. 4. The method of claim 1, further comprising providing a visual display of the level set function.
 5. The method of claim 1, further comprising designing an ink-jet print head using results of the simulation of the flow of the viscoelastic fluid.
 6. The method of claim 1, wherein the normalized relaxation time is normalized relative to a width of an opening of the channel.
 7. The method of claim 1, wherein the normalized relaxation time is normalized relative to a velocity scale.
 8. The method of claim 1, wherein the method is performed by an algorithm that is explicit on an advection term, semi-implicit on a viscosity term, and implicit on a relaxation term.
 9. The method of claim 8, wherein the advection term is evaluated using a Taylor expansion in both space and time, wherein the viscosity term is extrapolated in space from both the right and the left and a Godunov type upwinding is used to choose which extrapolation is evaluated.
 10. The method of claim 8, wherein evaluating the relaxation term implicitly includes modifying a viscoelastic stress equation which describes the evolution of viscoelastic stress over time, wherein: the viscoelastic stress equation is discretized in time to form a time discretized viscoelastic stress equation that describes the evolution of the viscoelastic stress from a first point in time to a second point in time; the relaxation term is a function of at least a viscoelastic relaxation time of the first fluid; a viscoelastic stress tensor is evaluated at the second point in time; and the time discretized viscoelastic stress equation is algebraically modified such that a viscoelastic stress tensor at a second point in time is described relative to a viscoelastic stress tensor at the first point in time.
 11. The method of claim 10, wherein the relaxation term is also a function of the level set function.
 12. The method of claim 1, wherein the droplet is formed, does not pinch off, and the simulation is stable over a period of time that includes the formation of the droplet, an extension of the droplet above an initial interface, and a retraction of the droplet towards the initial interface.
 13. The method of claim 1, wherein a level set projection method is also performed to solve the equations governing the viscoelastic flow of the first fluid. 